$input_file = $ARGV[0];
$output_file = $ARGV[1];
chomp($input_file);
chomp($output_file);
open BUFF,"<$input_file" or die "can't open the file $input_file";
open(WRBUFF,">$output_file");
while($line = <BUFF>)
{
	chomp($line);
	@array = split(/\t/,$line);
                $a1 = $array[3];
                $a2 = $array[4];
	if($a1 ne "-" && $a2 ne "-" && length($a1) == 1 && length($a2) == 1)
	{
		$k =0;
		$chr = $array[0];
		$pos = $array[1];
		if($array[5] eq "hom")
		{
			$snp = "1/1";
		}	
		elsif($array[5] eq "het")
		{
			$snp = "0/1";
		}
		else
		{
			print $line."\n";
			$k =1;
		}
		$qual = $array[6];
		$numb = $array[7];
		$numb =~ s/\^//g;
		$numb =~ s/\$//g;
		$num_reads = length($numb);
		if($k == 0)
		{
			print WRBUFF $chr."\t".$pos."\t".$a1."\t".$a2."\t".$snp."\t".$qual."\t".$num_reads."\n";
			#print "$chr"."_"."$pos"."__"."$a1"."_"."$a2"."__".$input_file."\n";
			print "$chr"."_"."$pos"." "."$a1"."_"."$a2"."\n";
		}
	}	
}
